home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2001 April
/
PCWorld_2001-04_cd.bin
/
Komunik
/
mozilla
/
MacOS
/
MacMozillaInstaller-0.8.sea-2.bin
/
Mozilla Installer
/
Installer Modules
/
mail.xpi
/
install.js
Wrap
Text File
|
2001-02-15
|
2KB
|
61 lines
// this function verifies disk space in kilobytes
function verifyDiskSpace(dirPath, spaceRequired)
{
var spaceAvailable;
// Get the available disk space on the given path
spaceAvailable = fileGetDiskSpaceAvailable(dirPath);
// Convert the available disk space into kilobytes
spaceAvailable = parseInt(spaceAvailable / 1024);
// do the verification
if(spaceAvailable < spaceRequired)
{
logComment("Insufficient disk space: " + dirPath);
logComment(" required : " + spaceRequired + " K");
logComment(" available: " + spaceAvailable + " K");
return(false);
}
return(true);
}
var srDest = 4488;
var err = initInstall("Mozilla Mail", "Mail", "5.0.0.2001021502");
logComment("initInstall: " + err);
var fProgram = getFolder("Program");
logComment("fProgram: " + fProgram);
if (verifyDiskSpace(fProgram, srDest))
{
err = addDirectory("Program",
"5.0.0.2001021502",
"viewer", // jar source folder
fProgram, // target folder
"", // target subdir
true ); // force flag
logComment("addDirectory() returned: " + err);
err = registerChrome(CONTENT | DELAYED_CHROME,
getFolder("Chrome","messenger.jar"),
"content/messenger/");
logComment("registerChrome() returned: " + err);
if (err==SUCCESS)
{
err = performInstall();
logComment("performInstall() returned: " + err);
}
else
{
cancelInstall(err);
logComment("cancelInstall() due to error: " + err);
}
}
else
cancelInstall(INSUFFICIENT_DISK_SPACE);